package com.mtgdeckbuilder.client;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.mtgdeckbuilder.shared.dto.DeckDTO;

/**
 * The asynchronous counterpart of <code>DeckService</code>.
 * 
 * @author Nicolas Deslandes
 */
public interface DeckServiceAsync {

   /**
    * Fetch the deck by its key from a source.
    * 
    * @param id the id of the deck.
    * @param callback the asynchronous callback that contains the card response.
    */
   void fetch(long id, AsyncCallback<DeckDTO> callback);

   /**
    * Query a list of decks with arguments.
    * 
    * @param args the object that contains the arguments of the query.
    * @param callback the asynchronous callback that contains the list of found decks.
    */
   void query(DeckDTO args, AsyncCallback<List<DeckDTO>> callback);

   /**
    * Save a deck.
    * 
    * @param deck the deck to save.
    * @param callback the asynchronous callback that contains nothing.
    */
   void save(final DeckDTO deck, AsyncCallback<Void> callback);

}
